<script>
function checkform(){
	var subject=$('input[name="subject"]').val();
	if(trim(subject)==''){
		alert('请填写公告主题!');
		return false;		
	}
	
	var content = FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML( true );
	if(trim(content)==''){
		alert('请填写好公告描述!');
		return false;
	}
	commonEffection.setLoading();
	$('#addAdForm').submit();
}
	upload.type='ad';
	upload.formid='addAdForm';
	upload.setAppend=function(imgurl){
		return '<div style="margin:10px"><a href="'+imgurl+'" target="_blank"><img style="height:100px;width:100px;vertical-align:middle;border:1px #cccccc dashed" src="'+imgurl+'" /></a> 图片说明:<input type="text" name="imgIntro[]" value="" /><input type="hidden" name="imgUrl[]" value="'+imgurl+'" />　<input type="button" value="插入" onclick="commonEffection.InserImg(\''+imgurl+'\');" />　<input type="button" value="删除" onclick="upload.delimg(this);" /></div>';
	}
</script>
<div class="frame_addfactoryDiv">
  <form name="addAdForm" id="addAdForm" enctype="multipart/form-data"  action="administrator<?=CHOSING_DE?>ad<?=CHOSING_DE?>doadd" method="post">
  <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#c8d9e9">
    <tr>
      <td width="15%" class="ri-bbgg"><span class="red">*</span> 标题：</td>
      <td width="85%" class="le">
	  	<input name="subject" type="text" id="subject" value="" size="60" maxlength="40">
	  </td>
    </tr>
    <!-- <tr>
      <td width="15%" class="ri-bbgg">连接：</td>
      <td width="85%" class="le">
	  	<input name="url" type="text" id="url" value="" size="60">留容,表示没有连接
	  </td>
    </tr> -->
	<!--<tr>
      <td width="15%" class="ri-bbgg"><span class="red">*</span> 公告有效期：</td>
      <td width="85%" class="le">
	  	<input type="text" name="valid_days" maxlength="6" value="0" id="valid_days"> 天 ( 0为不限期 )
	  </td>
    </tr> -->
    <tr>
      <td class="ri-bbgg">内容：</td>
      <td class="le">
        <div><?=$this->oFCKeditor->Create();?></div>
	  </td>
    </tr>
	<!--<tr>
	  <td class="ri-bbgg"><span class="red">*</span> 上传图片：</td>
	  <td class="le"><span><input name="productpic" type="file" id="productpic" /></span>　<input type="button" onclick="upload.uploadimg(this);" value="上传" />　( 可连续上传多幅 )</td>
	</tr>
	<tr>
	  <td class="ri-bbgg">图片效果：</td>
	  <td class="le">
		<div id="productImages"></div>
		<iframe id="productIframe" width="0" height="0" name="productIframe"></iframe>
	  </td>
	</tr> -->
    <tr>
      <td colspan="2" class="se" align="center">
        <input name="button2" type="button" class="iput" value="保 存"   onclick="checkform();" />　　
        <input name="button" type="button" class="iput" value="返 回" onclick="commonEffection.confirmBack();" />
      </td>
    </tr>
  </table>

